﻿// 项目：	Guan.CMS.Web - Guan.CMS
// 文件名：	DomainToViewModelMappingProfile.cs
// 
// 修改时间：2013-03-09 12:26
// 修改人：	Cooclsee

using AutoMapper;
using Guan.CMS.Model.Entities;
using Guan.CMS.Web.ViewModels;
using Guan.CMS.Web.ViewModels.Article;
using Guan.CMS.Web.ViewModels.Page;
using Guan.CMS.Web.ViewModels.Product;
using Guan.CMS.Web.ViewModels.ProductCategory;

namespace Guan.CMS.Web.Mappers
{
    public class DomainToViewModelMappingProfile : Profile
    {
        public override string ProfileName
        {
            get { return "DomainToViewModelMappingProfile"; }
        }

        protected override void Configure()
        {
            Mapper.CreateMap<SiteConfig, SiteConfigFormModel>();
            Mapper.CreateMap<Article, ArticleSummaryViewModel>();
            Mapper.CreateMap<Article, ArticleListViewModel>();
            Mapper.CreateMap<Article, ArticleDetailViewModel>();
            Mapper.CreateMap<Article, ArticleFormModel>();
            Mapper.CreateMap<Article, AboutusViewModel>();
            Mapper.CreateMap<ProductCategory, ProductCategoryViewModel>();
            Mapper.CreateMap<ProductCategory, ProductCategoryTree>();
            Mapper.CreateMap<ProductCategory, ProductCategoryFormModel>();
            Mapper.CreateMap<Product, ProductViewModel>();
            Mapper.CreateMap<Product, ProductFormModel>();
            Mapper.CreateMap<Product, ProductDetailViewModel>();
            Mapper.CreateMap<Product, ProductListViewModel>();

            /*Mapper.CreateMap<Expense, ExpenseFormModel>().ForMember(dest => dest.Category, opt => opt.Ignore());*/
        }
    }
}